package cate.game.activity.rebate.msg;


import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.activity.rebate.RebateActivity;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBRebateActivity;

@ClientMsg(title = "领取储金返利奖励的请求")
@OperationSetter(GDOperation.REBATE_REWARD)
public class GetRebateRewardReq implements MsgInput {
    public int funcId;
    public int tid;
    @Override
    public void execute(GameBody game, ClientContext cc) {
        RebateActivity r = cc.getRole().getActivity().getEnableActivitySingle(funcId);
        if (r == null) {
            cc.getRole().getGame().notice.message(cc.getRole(), "活动未开启");
            return;
        }
        r.getReward(tid);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBRebateActivity.GET_REBATE_REWARD_REQ;
    }
}
